not Null Result
Converts the given value to a Result, that stores a NullPointerException when the value is null.
Samples
import dev.kikugie.commons.result.*
import kotlin.test.assertIs
import kotlin.test.assertTrue
fun main() {
//sampleStart
fun getNullable(str: String): String? =
if (str == "null") null else str
assertTrue(notNullResult(getNullable("any")).isSuccess)
assertTrue(notNullResult(getNullable("null")).isFailure)
//sampleEnd
}